/*
 *  Copyright (C) 2010 Matthias Buch-Kromann <mbk.isv@cbs.dk>
 * 
 *  This file is part of the IncrementalParser package.
 *  
 *  The IncrementalParser program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 * 
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 * 
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.osdtsystem.incparser.graphs;

/**
 *
 * @author Matthias Buch-Kromann <mbk.isv@cbs.dk>
 */
abstract class AbstractLocalGraph implements LocalGraph {
    // Graph manipulation
    abstract void removeInEdge(int edge);
    abstract void removeOutEdge(int edge);
    abstract void addInEdge(int edge);
    abstract void addOutEdge(int edge);

    // Cloning and trimming
    abstract void trimToSize();
    abstract void clear();

    @Override
    public AbstractLocalGraph clone() {
        try {
            return (AbstractLocalGraph) super.clone();
        } catch (CloneNotSupportedException ex) {
            throw new RuntimeException("LocalGraph should always be cloneable, but wasn't", ex);
        }
    }

    final static AbstractLocalGraph LOCALGRAPHTEMPLATE = new LocalGraphIntArray(0, 0, new int[0]);
}
